// Copyright  2012 Petr TALLA. [petr.talla@gmail.com]
// This file is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This file is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY;  without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
// [http://www.gnu.org/copyleft/lesser.html]
//=============================================================================

package tc.crase.meta;

import java.util.LinkedHashMap;
import java.util.Vector;

import tc.common.symbology.Legend;
import tc.common.utility.Pair;

public class Metadata {
	public Vector<LinkEstimate> estimates = new Vector<LinkEstimate>(); 
	public LinkedHashMap<String, Type> types = new LinkedHashMap<String, Type>();
	public Legend legend = new Legend();
	
	public void searchEstimates (String type1, String type2, Vector<Pair<LinkEstimate, Boolean>> matches) {
		for ( int i = 0; i < estimates.size(); i++ ) {
			LinkEstimate estimatei = estimates.get(i);
			if (estimatei.fits(type1, type2) ) {
				matches.add(new Pair<LinkEstimate, Boolean>(estimatei, new Boolean(false)));
				continue;
			}
			if (estimatei.fits(type2, type1) ) {
				matches.add(new Pair<LinkEstimate, Boolean>(estimatei, new Boolean(true)));
			}
		}
	}
		
	public Metadata() {
	}
}
